#ifndef SERVER_H_
#define SERVER_H_

#include <sys/types.h>
#include <stdint.h>

#define MAXBUFFERLEN 1024
#define MAXCMDLEN 50
#define OPEN_MAX 100
#define LISTENQ 50
#define SERV_PORT 5000
#define INFTIM 1000

#define ENDIAN_BIG 1

typedef struct _raw_request_t{
	int fd;
	char buffer[MAXBUFFERLEN];
} raw_request_t;

typedef struct _request_t{
	int fd;
	char cmd[MAXCMDLEN];
	char content[MAXBUFFERLEN-MAXCMDLEN];
} request_t;

typedef struct _connection_t{
	int fd;
	struct event * read_ev;
	int state;
	char userid[100];
	time_t activetime;
} connection_t;

//void on_write(int sock, short event, void* arg);

extern int verbose;
//void release_sock_event(struct event * ev);
extern int daemonize(int nochdir, int noclose);
#endif /* SERVER_H_ */
